{{/* Display author list. */}}

{{ $taxonomy := "authors" }}
{{ with .Param $taxonomy }}
  {{ $link_authors := site.Params.link_authors | default true }}
  {{ range $index, $value := . }}
    {{- $profile_page := site.GetPage (printf "/%s/%s" $taxonomy (. | anchorize)) -}}
    {{- $name := $profile_page.Params.name | default ($value|markdownify) -}}
    {{- if gt $index 0 }}, {{ end -}}
    <span>
      {{- if and $profile_page $link_authors -}}
        <a href="{{$profile_page.RelPermalink}}">{{$name}}</a>
      {{- else -}}
        {{$name}}
      {{- end -}}
    </span>
  {{- end -}}
{{ end }}
